<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVerifyPhoneTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('verify_phone')) {
            Schema::create('verify_phone', function (Blueprint $table) {
                $table->increments('id')         ->comment('验证码标识');
                $table->string('phone',11)       ->comment('手机号');
                $table->string('verify_code',8)  ->comment('验证码');
                $table->string('ip')             ->comment('请求ip');
                $table->string('ensure_session') ->nullable()  ->comment('请求的session,备用短信快捷登录');
                $table->softDeletes();
                $table->timestamps();
            });
        }

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('verify_phone');
    }
}
